package com.ukao.cashregister.consts;

import android.content.Context;

import com.ukao.cashregister.utils.SpUtils;
import com.ukao.cashregister.utils.Utils;

import static cn.jiguang.analytics.android.api.JAnalyticsInterface.mContext;
import static com.ukao.cashregister.eventbus.MembershipCardEvent.Message.login;

/**
 * Created by Administrator on 2017/2/23.
 */

public class SaveParamets {


    public static boolean isRfidLabel() {

        return (boolean) SpUtils.get(Utils.getContext(), "rfidLabel", false);

    }

    public static void setRfidLabel(boolean rfidLabel) {

        SpUtils.put(Utils.getContext(), "rfidLabel", rfidLabel);
    }

    public static String getStoreId() {
        return SpUtils.get(Utils.getContext(), "storeId", "").toString();
    }


    public static void setStoreId(String storeId) {
        SpUtils.put(Utils.getContext(), "storeId", storeId);
    }

    public static String getCode() {

        return SpUtils.get(Utils.getContext(), "code", "").toString();
    }

    public static void setCode(String code) {

        SpUtils.put(Utils.getContext(), "code", code);
    }

    public static String getAccount() {
        return SpUtils.get(Utils.getContext(), "account", "").toString();
    }

    public static void setAccount(String account) {

        SpUtils.put(Utils.getContext(), "account", account);
    }

    public static String getMercInfo() {
        return SpUtils.get(Utils.getContext(), "mercInfo", "").toString();

    }

    public static void setMercInfo(String mercInfo) {
        SpUtils.put(Utils.getContext(), "mercInfo", mercInfo);
    }

    public static String getMercLogoPath() {
        return SpUtils.get(Utils.getContext(), "mercLogoPath", "").toString();
    }

    public static void setMercLogoPath(String mercLogoPath) {
        SpUtils.put(Utils.getContext(), "mercLogoPath", mercLogoPath);
    }

    public static String getMercMainInfo() {
        return SpUtils.get(Utils.getContext(), "mercMainInfo", "").toString();
    }

    public static void setMercMainInfo(String mercMainInfo) {
        SpUtils.put(Utils.getContext(), "mercMainInfo", mercMainInfo);
    }

    public static String getStoreName() {
        return SpUtils.get(Utils.getContext(), "storeName", "").toString();

    }

    public static void setStoreName(String storeName) {

        SpUtils.put(Utils.getContext(), "storeName", storeName);
    }

    public static String getCreateTimep() {


        return SpUtils.get(Utils.getContext(), "createTimep", "").toString();

    }

    /**
     * @param createTimep 創建時間
     */
    public static void setCreateTimep(String createTimep) {
        SpUtils.put(Utils.getContext(), "createTimep", createTimep);
    }

    public static String getAddrDesc() {

        return SpUtils.get(Utils.getContext(), "addrDesc", "").toString();
    }

    /**
     * @param addrDesc 地址
     */
    public static void setAddrDesc(String addrDesc) {
        SpUtils.put(Utils.getContext(), "addrDesc", addrDesc);
    }


    public static String getRegionalDesc() {

        return SpUtils.get(Utils.getContext(), "regionalDesc", "").toString();
    }

    public static void setRegionalDesc(String regionalDesc) {

        SpUtils.put(Utils.getContext(), "regionalDesc", "");
    }

    public static void saveHeadimgPath(Context mContext, String phone) {
        SpUtils.put(mContext, "imgPath", phone);

    }

    public static String getHeadimgPath(Context mContext) {
        return SpUtils.get(mContext, "imgPath", "").toString();

    }

    public static void saveUsePhone(Context mContext, String phone) {
        SpUtils.put(mContext, "phone", phone);

    }

    public static void saveloginSign(Context mContext, String loginSign) {
        SpUtils.put(mContext, "loginSign", loginSign);

    }

    public static String getsaveloginSign(Context mContext) {
        return SpUtils.get(mContext, "loginSign", "").toString();

    }


    public static void setIslogin(boolean islogin) {
        SpUtils.put(Utils.getContext(), "islogin", islogin);

    }

    public static boolean isLogin() {
        return (boolean) SpUtils.get(Utils.getContext(), "islogin", false);

    }

    public static void saveUseName(Context mContext, String name) {
        SpUtils.put(mContext, "name", name);

    }

    public static void saveToken(Context mContext, String token) {
        SpUtils.put(mContext, "token", token);

    }

    public static String getToken(Context mContext) {
        return SpUtils.get(mContext, "token", "").toString();

    }

    public static String getSaveUseName(Context mContext) {

        return SpUtils.get(mContext, "name", "").toString();
    }


    public static String getSaveUsePhone(Context mContext) {

        return SpUtils.get(mContext, "phone", "").toString();

    }

    //保存到店记录tab position
    public static int getsaveArriveShopPosition() {
        return (Integer) SpUtils.get(Utils.getContext(), "arriveShopPosition", Integer.valueOf(0));
    }

    public static void saveArriveShopPosition(int position) {
        SpUtils.put(Utils.getContext(), "arriveShopPosition", Integer.valueOf(position));
    }


    public static boolean getTagPrinState() {

        return (boolean) SpUtils.get(Utils.getContext(), "tagstate", true);

    }

    public static void setTagPrinState(boolean isopen) {

        SpUtils.put(Utils.getContext(), "tagstate", isopen);

    }


}
